package me.nibo.webframework.service;

import me.nibo.webframework.dao.GroupDao;
import me.nibo.webframework.dao.UserDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

/**
 * 用户业务处理类
 * Created by nibo on 2015/7/30.
 */
@Service
@Transactional
public class UserService {

    private static final Logger LOGGER = LoggerFactory.getLogger(UserService.class);

    @Autowired
    private UserDao userDao;
    @Autowired
    private GroupDao groupDao;

    public Map<String, Object> getUser(Long id) {
        Map<String, Object> map = userDao.get(id);
        LOGGER.debug("{}", map);
        return map;
    }

    public Map<String, Object> getGroup(long id) {
        Map<String, Object> map = groupDao.get(id);
        LOGGER.debug("{}", map);
        return map;
    }
}
